<?php

/**
 * sfGuardFormSignin for sfGuardAuth signin action
 *
 * @package    sfDoctrineGuardPlugin
 * @subpackage form
 * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
 * @version    SVN: $Id: sfGuardFormSignin.class.php 23536 2009-11-02 21:41:21Z Kris.Wallsmith $
 */
class sfGuardFormSignin extends BasesfGuardFormSignin
{
  /**
   * @see sfForm
   */
    public function configure()
    {        
        $this->widgetSchema->setLabels(array(
            'username' => 'Usuario o Email',
            'password' => 'Constraseña',
            'remember' => 'Recuerdame',
        ));
        
        if($this->getOption('formatter') == 'div'){
            
            $this->widgetSchema['username']->setAttribute('class','title');
            $this->widgetSchema['password']->setAttribute('class','title');
            
            $this->widgetSchema->setFormFormatterName('div');
        }
        
        $this->validatorSchema['username']->setMessage('required', 'Indique su Usuario o Email');
        
        $this->validatorSchema['password']->setMessage('required', 'Indique su contraseña');
        
        $this->validatorSchema->setPostValidator(new sfGuardValidatorUser(array(),
                array('invalid' => 'Usuario y/o Contraseña invalida')));
    }
}
